<?php

/**
 * InputMonthlyForecast form base class.
 *
 * @method InputMonthlyForecast getObject() Returns the current form's model object
 *
 * @package    TMD
 * @subpackage form
 * @author     Thaihosting
 */
abstract class BaseInputMonthlyForecastForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'DTTIME_FORECAST'        => new sfWidgetFormInputHidden(),
      'IGEOGRAPHIC_REGION'     => new sfWidgetFormInputHidden(),
      'DTSAVE_TIME'            => new sfWidgetFormDateTime(),
      'IUSER_ID'               => new sfWidgetFormInputText(),
      'ITEMP_MAX_LOWBOUND'     => new sfWidgetFormInputText(),
      'ITEMP_MAX_HIGHBOUND'    => new sfWidgetFormInputText(),
      'ITEMP_MIN_LOWBOUND'     => new sfWidgetFormInputText(),
      'ITEMP_MIN_HIGHBOUND'    => new sfWidgetFormInputText(),
      'IWIND_DIRECTION'        => new sfWidgetFormInputText(),
      'IWIND_SPEED_LOWBOUND'   => new sfWidgetFormInputText(),
      'IWIND_SPEED_HIGHBOUND'  => new sfWidgetFormInputText(),
      'IRAINFALL_LOWBOUND'     => new sfWidgetFormInputText(),
      'IRAINFALL_HIGHBOUND'    => new sfWidgetFormInputText(),
      'INUMDATE_RAINFALL_LOW'  => new sfWidgetFormInputText(),
      'INUMDATE_RAINFALL_HIGH' => new sfWidgetFormInputText(),
      'IHUMIDITY_LOWBOUND'     => new sfWidgetFormInputText(),
      'IHUMIDITY_HIGHBOUND'    => new sfWidgetFormInputText(),
      'SDESC_TH'               => new sfWidgetFormTextarea(),
      'SDESC_ENG'              => new sfWidgetFormTextarea(),
      'SWARNING_TH'            => new sfWidgetFormTextarea(),
      'SWARNING_ENG'           => new sfWidgetFormTextarea(),
      'IWEATHER_TYPE'          => new sfWidgetFormInputText(),
      'IWAVE_TYPE'             => new sfWidgetFormInputText(),
      'ITEMPERATURE_TYPE'      => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'DTTIME_FORECAST'        => new sfValidatorChoice(array('choices' => array($this->getObject()->getDttimeForecast()), 'empty_value' => $this->getObject()->getDttimeForecast(), 'required' => false)),
      'IGEOGRAPHIC_REGION'     => new sfValidatorChoice(array('choices' => array($this->getObject()->getIgeographicRegion()), 'empty_value' => $this->getObject()->getIgeographicRegion(), 'required' => false)),
      'DTSAVE_TIME'            => new sfValidatorDateTime(),
      'IUSER_ID'               => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'ITEMP_MAX_LOWBOUND'     => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'ITEMP_MAX_HIGHBOUND'    => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'ITEMP_MIN_LOWBOUND'     => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'ITEMP_MIN_HIGHBOUND'    => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'IWIND_DIRECTION'        => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'IWIND_SPEED_LOWBOUND'   => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'IWIND_SPEED_HIGHBOUND'  => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'IRAINFALL_LOWBOUND'     => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'IRAINFALL_HIGHBOUND'    => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'INUMDATE_RAINFALL_LOW'  => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'INUMDATE_RAINFALL_HIGH' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'IHUMIDITY_LOWBOUND'     => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'IHUMIDITY_HIGHBOUND'    => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'SDESC_TH'               => new sfValidatorString(array('max_length' => 2147483646, 'required' => false)),
      'SDESC_ENG'              => new sfValidatorString(array('max_length' => 2147483646, 'required' => false)),
      'SWARNING_TH'            => new sfValidatorString(array('max_length' => 2147483646, 'required' => false)),
      'SWARNING_ENG'           => new sfValidatorString(array('max_length' => 2147483646, 'required' => false)),
      'IWEATHER_TYPE'          => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'IWAVE_TYPE'             => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'ITEMPERATURE_TYPE'      => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('input_monthly_forecast[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'InputMonthlyForecast';
  }


}
